package com.dmcb.trade.business.crawlers.article;

import com.dmcb.trade.business.constants.CrawlConstant;
import org.jsoup.nodes.Document;
import org.springframework.stereotype.Service;

/**
 * Created by Administrator on 2016/6/20.
 */
@Service
public class ZhongXiRuanParser  extends BaseParser {

    /**
     * 网站URL网址
     *
     * @return 链接
     */
    @Override
    protected String url() {
        return CrawlConstant.ZHONGXIRUAN_URL;
    }

    /**
     * 获取标题选择器
     *
     * @return 标题选择器
     */
    @Override
    protected String titleSelect() {
        return "div.dee_woed h3.title";
    }

    /**
     * 获取日期选择器
     *
     * @return 发布日期选择器
     */
    @Override
    protected String dateSelect() {
        return "div.dee_woed>h3.title>span.t_time";
    }

    /**
     * 获取正文内容选择器
     *
     * @return 正文内容选择器
     */
    @Override
    protected String bodySelect() {
        return "div.dee_woed>div.con_word";
    }

    /**
     * 获取封面选择器
     *
     * @return 封面选择器
     */
    @Override
    protected String coverSelect() {
        return "div.dee_woed>div.con_word img[src]";
    }

    @Override
    protected String titleProcess(Document doc, String title) {
        title = title.substring(0,title.indexOf("发布时间："));
        return super.titleProcess(doc, title);
    }

    @Override
    protected String platform() {
        return "中细软";
    }
}
